﻿using ABPLHQCS.Application;
using ABPLHQCS.Books;
using ABPLHQCS.FormInstances;
using Asp.Versioning;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.AspNetCore.Mvc;

using Microsoft.AspNetCore.Antiforgery;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.AntiForgery;
using Volo.Abp.Application.Dtos;

namespace ABPLHQCS.Controllers.FormInstances
{
    [RemoteService]
    [Area("app")]
    [ControllerName("FormInstance")]
    [Route("api/app/FormInstances")]
    public class FormInstanceController:ABPLHQCSController
    {
        protected IFormInstanceAppService _formInstancesAppService;

        public FormInstanceController(IFormInstanceAppService formInstancesAppService)
        {
            _formInstancesAppService = formInstancesAppService;
        }



        [HttpPost]
        [IgnoreAntiforgeryToken]
        public virtual Task<FormInstanceDto> CreateAsync(FormInstanceCreateAndUpdateDto input)
        {
            return _formInstancesAppService.CreateAsync(input);
        }

        [HttpGet]
        [IgnoreAntiforgeryToken]
        public virtual Task<PagedResultDto<FormInstanceDto>> GetFormInstancesAsync(PagedAndSortedResultRequestDto input)
        {
           
            return _formInstancesAppService.GetListAsync(input);
        }



    }
}
